package com.it.travel.service.impl;

import com.it.travel.dao.CategoryDao;
import com.it.travel.pojo.Category;
import com.it.travel.service.CategoryService;
import com.it.travel.vo.ResultInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service("categoryService")
@Transactional(propagation = Propagation.SUPPORTS,readOnly = true)
public class CategoryServiceImpl implements CategoryService {

    @Autowired
    private CategoryDao categoryDao;

    /**
     * 旅游产品分类查询功能实现
     * @return
     */
    @Override
    public ResultInfo findAllCategory() {
        List<Category> categories = categoryDao.findAllCategory();

        return new ResultInfo(true,categories,null);
    }
}
